import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:svgaplayer_flutter/player.dart';

import '../controllers/dd_home_controller.dart';
import '../views/dd_simple_player.dart';

class DDHomePage extends StatefulWidget {
  const DDHomePage({Key? key}) : super(key: key);

  @override
  State<DDHomePage> createState() => _DDHomePageState();
}

class _DDHomePageState extends State<DDHomePage> {
  DDHomeController _contorller = DDHomeController();

  @override
  Widget build(BuildContext context) {
    return GetBuilder<DDHomeController>(
        init: _contorller,
        initState: (state) {},
        dispose: (state) {},
        builder: (controller) {
          return Scaffold(
              backgroundColor: Colors.white,
              body: SafeArea(
                top: false,
                child: Stack(
                        children: [
                          const Positioned.fill(
                            child: SizedBox(
                                child: SVGDDASimpleImage(
                                    assetsName: 'assets/source/fast.svga')),
                          ),
                          Align(
                              alignment: Alignment.bottomCenter,
                              child: Padding(
                                  padding: const EdgeInsets.only(bottom: 50.0),
                                  child: GestureDetector(
                                    onTap: () {
                                      _contorller.pushHomeSecond();
                                    },
                                    child: Container(
                                      width: 331,
                                      height: 54,
                                      decoration: BoxDecoration(
                                        color: Color(0xFF53BFD7),
                                        border: Border.all(
                                          color: Color(0xFF4C5961),
                                          width: 1,
                                        ),
                                        borderRadius: BorderRadius.circular(8),
                                        boxShadow: const [
                                          BoxShadow(
                                            color: Colors.black,
                                            spreadRadius: 1,
                                            blurRadius: 0,
                                            offset: Offset(1, 1),
                                          ),
                                        ],
                                      ),
                                      child: const Align(
                                        alignment: Alignment.center,
                                        child: Text(
                                          'Tap  to  start',
                                          style: TextStyle(
                                            fontFamily: 'LINESeedSans_A_XBd',
                                            color: Color(0xFFFFFFFF),
                                            fontSize: 20,
                                            letterSpacing: 0,
                                          ),
                                        ),
                                      ),
                                    ),
                                  ))),
                        ],
                      ),
              ),);
        });
  }
}
